package QQ;

import java.util.LinkedList;

public class QQ {
    public static void main(String[] args) {
        String[] strs = {"12345", "67891", "12347809933", "98765432102", "67891", "12347809933"};
        LinkedList<String> list = new LinkedList<>();
        list.addFirst(strs[0]);//12345
        list.add(strs[1]);//67891
        list.add(strs[2]);//12347809933
        list.add(strs[3]);//67891
        list.add(strs[4]);//67891
        list.addLast(strs[5]);//12347809933
    for (int j=0;j<list.size();j++){
            for (int i = 1; i <strs.length; i++) {
                if (list.get(j).equals(strs[i])&&j!=i){
                    list.remove(i);
                    break;
                }
            }
    }
        for (String str:list){
            String s=(String)str;
            System.out.println(s);
        }
    }

}
